//
//  Student.m
//  Demo0007
//
//  Created by zTercel on 13-1-3.
//  Copyright (c) 2013年 zTercel. All rights reserved.
//

#import "Student.h"

static int gCount;

@implementation Student
@synthesize _id;

-(id) init: (const char*) name age: (char) age sex: (BOOL) sex
{
    self = [super init];
    if (self)
    {
        strcpy(_name, name);
        _age = age;
        _sex = sex;
    }
    gCount++;
    _id = gCount;
    return self;
}

-(void) print
{
    NSLog(@"\nstudent(%d) infomation:\n...name: %s\n...age : %d\n...sex : %s", _id, _name, _age, (_sex == YES) ? "male" : "female");
}

+(int) count
{
    extern int gCount;
    return gCount;
}

@end
